//
//  CustomSecondTwoCollectionViewCell.m
//  AmountBody
//
//  Created by smm on 2018/1/3.
//  Copyright © 2018年 RCMTM. All rights reserved.
//

#import "CustomSecondTwoCollectionViewCell.h"
static const CGFloat itemHeight = 40;
@implementation CustomSecondTwoCollectionViewCell
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubViews];
    }
    return self;
}

-(void)initSubViews
{
     _delButton = [[UIButton alloc]init];
    [self addSubview:_delButton];
    _nameLabel = [[UILabel alloc]init];
    [self addSubview:_nameLabel];
}
-(void)setCellWithModel:( CustomSecondModel*)model
{
    CGFloat buttonW = 40;
    CGFloat buttonH = 40;
    [_delButton setImage:[UIImage imageNamed:@"c_del"] forState:UIControlStateNormal];
    [_delButton setImage:[UIImage imageNamed:@"c_del"] forState:UIControlStateSelected];
    _delButton.frame = CGRectMake(_cell_width-buttonW, 0, buttonW, buttonH);
//    [_delButton mas_remakeConstraints:^(MASConstraintMaker *make) {
//        make.right.equalTo(self);
//        make.width.height.equalTo(@(buttonH));
//        make.centerY.equalTo(self);
//    }];
    _nameLabel.numberOfLines = 0;
    _nameLabel.textAlignment = NSTextAlignmentRight;
    _nameLabel.text = model.name;
    _nameLabel.textColor = QianZi_color;
    _nameLabel.font = Cell_Little_Font;
    [_nameLabel sizeToFit];
    _nameLabel.frame = CGRectMake(5, 0, _cell_width-buttonW-5, buttonH);
//    [_nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
////        make.left.equalTo(self);
//        make.width.equalTo(@(_cell_width));
//        make.right.equalTo(_delButton.mas_left).offset(-5);
//        make.top.bottom.equalTo(self);
////        make.centerY.equalTo(self);
//    }];
    
}


- (void)delButton:(id)sender {
    
}
@end
